package com.Shoping.service.impl;

import com.Shoping.dao.UserDao;
import com.Shoping.dao.impl.UserDaoImpl;
import com.Shoping.entity.User;
import com.Shoping.service.UserService;

import java.sql.SQLException;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();
    @Override
    public User selectByNamePwd(String userName, String password) throws SQLException {
        return userDao.selectByNamePwd(userName, password);
    }

    @Override
    public User selectByUsername(String userCode) throws SQLException {
        return userDao.selectByUsername(userCode);
    }

    @Override
    public void createUser(String userCode, String newPassword) throws SQLException {
        userDao.createUser(userCode,newPassword);
    }

    @Override
    public void updatePassowrd(String password,Integer uid) throws SQLException {
        userDao.updatePassowrd(password,uid);
    }
}
